home *** CD-ROM | disk | FTP | other *** search
/ Champak 49 / Volume 49 - JOGO DISK .iso / Games / jetski.swf / scripts / DefineSprite_64 / frame_1 / DoAction.as
Encoding:
Text File  |  2007-10-01  |  1.6 KB  |  69 lines

  1. function navigationF(typeV)
  2. {
  3.    var _loc1_ = this;
  4.    if(typeV == "prev")
  5.    {
  6.       _loc1_.selectNumV = _loc1_.selectNumV - 1;
  7.       if(_loc1_.selectNumV <= 1)
  8.       {
  9.          _loc1_.selectNumV = 1;
  10.       }
  11.    }
  12.    else if(typeV == "next")
  13.    {
  14.       _loc1_.selectNumV = _loc1_.selectNumV + 1;
  15.       if(_loc1_.selectNumV >= 5)
  16.       {
  17.          _loc1_.selectNumV = 5;
  18.       }
  19.    }
  20.    if(_loc1_.selectNumV == 1)
  21.    {
  22.       _loc1_.btn_prev._alpha = 50;
  23.       _loc1_.btn_next._alpha = 100;
  24.       _loc1_.btn_prev.enabled = false;
  25.       _loc1_.btn_next.enabled = true;
  26.    }
  27.    else if(_loc1_.selectNumV == 5)
  28.    {
  29.       _loc1_.btn_prev._alpha = 100;
  30.       _loc1_.btn_next._alpha = 50;
  31.       _loc1_.btn_prev.enabled = true;
  32.       _loc1_.btn_next.enabled = false;
  33.    }
  34.    else
  35.    {
  36.       _loc1_.btn_prev._alpha = 100;
  37.       _loc1_.btn_next._alpha = 100;
  38.       _loc1_.btn_next.enabled = true;
  39.       _loc1_.btn_prev.enabled = true;
  40.    }
  41.    _loc1_.subPageM.targetXPosV = (_loc1_.selectNumV - 1) * _loc1_.stepWV * -1;
  42.    _loc1_.subPageM.onEnterFrame = function()
  43.    {
  44.       var _loc1_ = this;
  45.       _loc1_._x += (_loc1_.targetXPosV - _loc1_._x) * 0.34;
  46.       if(Math.abs(_loc1_.targetXPosV - _loc1_._x) <= 1)
  47.       {
  48.          _loc1_._x = _loc1_.targetXPosV;
  49.          _loc1_.onEnterFrame = null;
  50.       }
  51.    };
  52. }
  53. stop();
  54. this.stepWV = 295;
  55. this.selectNumV = 1;
  56. this.btn_prev.onPress = function()
  57. {
  58.    this._parent.navigationF("prev");
  59. };
  60. this.btn_next.onPress = function()
  61. {
  62.    this._parent.navigationF("next");
  63. };
  64. this.btnM_startGame.onPress = function()
  65. {
  66.    this._parent._parent.gotoAndPlay("onL");
  67. };
  68. this.navigationF("prev");
  69.